package com.dashunwms_aohe.controller;

import com.dashunwms_aohe.http.res.UploadBillRes;
import com.dashunwms_aohe.service.UploadBillService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("BtypeInfo")
@Api(tags = "上传单据")
@Slf4j
public class UploadbillController {

    @Resource
    private UploadBillService uploadBillService;

    @GetMapping("/uploadBuy")
    @ApiOperation(value = "上传采购订单", response = UploadBillRes.class)
    public UploadBillRes uploadBtype(String billCode) {
        log.info("上传采购订单:" + billCode);
        return uploadBillService.uploadBuyBillToDS(billCode);

    }


    @GetMapping("/uploadSale")
    @ApiOperation(value = "上传销售单", response = UploadBillRes.class)
    public UploadBillRes uploadSale(String billCode) {
        log.info("上传销售单:" + billCode);
        return uploadBillService.uploadSaleBillToDS(billCode);

    }
}
